#include "Blocks/ButtonBlock.h"

namespace PocketSurvival
{
    int32_t ButtonBlock::getIndex()
    {
        return Index();
    }
    const std::string &ButtonBlock::getBlockName()
    {
        static std::string blockName = "ButtonBlock";
        return blockName;
    }

    int32_t ButtonBlock::getFace(int32_t value)
    {
        return Terrain::ExtractData(value) & 7;
    }

    const std::vector<BoundingBox> &ButtonBlock::getCustomCollisionBoxes(int32_t value)
    {
        int32_t face = getFace(value);
        if (face < GET_ARRAY_LEN(BlockConstans::buttonCollisionBoxes))
        {
            return BlockConstans::buttonCollisionBoxes[face];
        }
        return BlockConstans::zeroCollisionBoxes;
    }
}